# coding = utf-8
from django.urls import path
from rest_framework.routers import DefaultRouter

from polls.api.views import QuestionViewSet, ChoiceViewSet, VoteDetailViewSet, ChoiceImageUploadAPIView, \
    ChoiceImageViewSet
from polls.api.wechat_views import WxQuestionViewSet

router = DefaultRouter()
router.register(r'question', QuestionViewSet, basename="question")
router.register(r'choice', ChoiceViewSet, basename="choice")
router.register(r'choice_image', ChoiceImageViewSet, basename="choice-image")
router.register(r'vote_detail', VoteDetailViewSet, basename="vote-detail")
# 微信
router.register(r'wx_question', WxQuestionViewSet, basename="wx-question")


urlpatterns = [
    path('image_upload/', ChoiceImageUploadAPIView.as_view(), name="api-choice-image-upload"),
]
urlpatterns += router.urls
